const express = require("express");
let app = express();
const static = express.static;
app.use(static("./static"));
app.get("/", (req, res) => {
  res.sendFile(__dirname + "/views/index.html");
});

app.get("/getdata", (req, res) => {
  res.json({
    info: "成功",
    status: 1,
  });
});
app.post("/getdata", (req, res) => {
  res.json({
    info: "post成功",
    status: 1,
  });
});
app.get("/getusers", (req, res) => {
  setTimeout(() => {
    res.json({
      info: "用户成功",
      status: 1,
    });
  }, 2000);
});
app.listen(8989);
